From: Georges Basile Stavracas Neto Date: Tue, 1 Dec 2020 01:14:17 +0000 (-0300) Subject: iconGrid/iconGridLayout: Make sure to always update best size X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~717 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4863c498b29173a7284c60a51b8854b2d2da55e8;p=gnome-shell.git iconGrid/iconGridLayout: Make sure to always update best size When selecting the best icon size for the available area, we iterate from the biggest icon size to the smallest one, and stop when finding a size that fits the available area. However, the 'bestSize' variable is only updated when the available area is positive. This is problematic in super bad cases like when none of the icon sizes actually fit the availabe area, which was hit with a previous iteration of this branch. Make sure to update the best size while iterating, so that the smallest size is selected even in such bad cases. Part-of: --- diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js index 7275a6a41..93fc6219f 100644 --- a/js/ui/iconGrid.js +++ b/js/ui/iconGrid.js @@ -429,10 +429,10 @@ var IconGridLayout = GObject.registerClass({ this._pageHeight - usedHeight - rowSpacingPerPage - this._pagePadding.top - this._pagePadding.bottom; - if (emptyHSpace >= 0 && emptyVSpace > 0) { - bestSize = size; + bestSize = size; + + if (emptyHSpace >= 0 && emptyVSpace > 0) break; - } } return bestSize;